﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Randata.Test.Model;

namespace Randata.Test
{
    [TestClass]
    public class ListTest
    {

        [TestMethod]
        public void ListDataProvider_Should_work()
        {
            List<int> list = DataProvider.Any<List<int>>();
        }

        [TestMethod]
        public void ListDataProvider_Should_not_be_empty()
        {
            List<int> list = DataProvider.Any<List<int>>();

            Assert.IsTrue(list.Count > 0);
        }

        [TestMethod]
        public void ListDataProvider_Should_has_diferent_children()
        {
            List<int> list = DataProvider.Any<List<int>>();

            Assert.IsFalse(list.All(x => x == list.First()));
        }

        [TestMethod]
        public void ListDataProvider_Should_has_diferent_children_even_when_custom()
        {
            List<Person> list = DataProvider.Any<List<Person>>();

            Assert.IsFalse(list.All(x => x.Age == list.First().Age || x.Name == list.First().Name));
        }

    }
}
